/*
测试：循环读取一个文件
*/
#include <stdio.h>
int main()
{
    char *filename = "/root/test.log";
	FILE *fp;
	int size=0;
	char c;
	if((fp=fopen( filename, "r")) == NULL ) {
		printf("open file %s error!\n", filename);
		return 0;
	}
	while((c=fgetc(fp))!=EOF){
		size++;
	}
	fclose(fp);
	printf("size:%d\n",size);

	return 0;
}
